# cmake 教程博客 https://www.subingwen.cn/cmake/CMake-primer/#2-3-%E6%90%9C%E7%B4%A2%E6%96%87%E4%BB%B6
# main 程序的可执行文件构建

# 指定最低版本
cmake_minimum_required(VERSION 3.10)

# 指定项目名称
project(cmake_learn)

# 指定头文件目录
include_directories(
    ${PROJECT_SOURCE_DIR}/src/myadd
    ${PROJECT_SOURCE_DIR}/src/mydiv
    ${PROJECT_SOURCE_DIR}/src/mymul
    ${PROJECT_SOURCE_DIR}/src/mysub
)

# 指定自己的静态库路径 标准库的不用指定
link_directories(${PROJECT_SOURCE_DIR}/lib)

# 链接自己的静态库 去头去尾写构建时候的 静态库名称 就行
link_libraries(calculate)

# 找源文件 main.cpp
aux_source_directory(${PROJECT_SOURCE_DIR} SRC)

# 设置可执行文件输出路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# 构建可执行文件
add_executable(main ${SRC})